package cn.tedu.xctf.boot21.Mapper;


import cn.tedu.xctf.boot21.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    //如果查询到的时一条数据可以通过一个自定义的对象接收,如果时多个数据通过一个
    //自定义对象接受就会报错
    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);

    @Insert("insert into user values(null,#{username},#{password},#{nick})")
    void insert(User user);
}
